import json
import pytest
import requests
from tools.read_Excel import read_data
from tools.read_pathlib import exc_path
from tools.handle_assert import handle_assert
all_case = read_data(exc_path=exc_path,sheetname="登录")
@pytest.mark.parametrize("data",all_case)
def test01_login(data):
    login_url = data["接口地址"]
    login_param = data["请求参数"]
    login_res = requests.request(method="post",url=login_url,json=json.loads(login_param))
    print(login_res.text)
    # 调用断言方法
    handle_assert(actual_res=login_res,expect=data["预期结果"])


